import config from "@/config"
import http from "@/utils/request"

export default {
    category: {
        add: {
            url: `${config.API_URL}/main/pm/category/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/category/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/category/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/category/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },

        productCategoryTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "部门信息树状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },



    },
    product: {
        add: {
            url: `${config.API_URL}/main/pm/product/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/product/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/product/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/product/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        batchEdit: {
            url: `${config.API_URL}/main/pm/productFile/batchEdit`,
            name: "初始化附件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        batchUpdate: {
            url: `${config.API_URL}/main/pm/productFile/batchUpdate`,
            name: "批量更新附件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        },
        deleteFile: {
            url: `${config.API_URL}/main/pm/productFile/delete`,
            name: "删除单个附件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        skuDetail: {
            url: `${config.API_URL}/main/pm/productsku/detail`,
            name: "获取SKU列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        getPropertyDtlList: {
            url: `${config.API_URL}/main/pm/productsku/getPropertyDtlList`,
            name: "获取属性值列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        generateProductSkuList: {
            url: `${config.API_URL}/main/pm/productsku/generateProductSkuList`,
            name: "生成产品sku列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        saveSKU: {
            url: `${config.API_URL}/main/pm/productsku/save`,
            name: "保存产品sku列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        },
        

    },
    brand:{
        detail: {
            url: `${config.API_URL}/main/pm/brand/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/brand/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/brand/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,{ headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
    },
    prop:{
        add:{
            url: `${config.API_URL}/main/pm/property/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/property/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/property/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/property/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    unit:{
        add:{
            url: `${config.API_URL}/main/pm/unit/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/unit/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/unit/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/unit/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    package:{
        add:{
            url: `${config.API_URL}/main/pm/package/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/package/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/package/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/package/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    qualityindex:{
        add:{
            url: `${config.API_URL}/main/pm/qualityindex/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/qualityindex/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/qualityindex/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/pm/qualityindex/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    packReq:{
        add:{
            url: `${config.API_URL}/main/pm/packReq/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/pm/packReq/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/pm/packReq/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
    },
}